/**
 * @name MenuBar
 * @desc 侧边菜单栏
 * @author darcrand
 * @version 2018-10-03
 */

import React, { Component } from 'react'
import RadioList from '@/components/RadioList'
import CheckList from '@/components/CheckList'
import './styles.scss'
import rightIco from '@/assets/icons/right.svg'

const radiusOptions = [{ label: '500', val: 500 }, { label: '1000', val: 1000 }, { label: '1500', val: 1500 }]
const peopleTypes = [{ label: '工作人员', val: 0 }, { label: '监护人', val: 1 }, { label: '患者', val: 2 }]

class MenuBar extends Component {
    static defaultProps = {
        show: false,
        handleArrow: () => {}
    }

    render() {
        const { show, handleArrow } = this.props
        return (
            <div classes={show ? 'container' : 'container hide'}>
                <div classes="content-list">
                    <RadioList title="半径范围" options={radiusOptions} />
                    <CheckList title="人员类型" options={peopleTypes} />
                </div>
                <div classes="arrow" onClick={() => handleArrow(!show)}>
                    <i
                        classes={show ? 'arrow-ico close' : 'arrow-ico'}
                        style={{ backgroundImage: `url("${rightIco}")` }}
                    />
                </div>
            </div>
        )
    }
}

export default MenuBar
